package org.maplanning.feature.rect;

import java.util.Arrays;

import org.maplanning.env.Area;

public class Door extends Area {
	/** Points away from the door, normal vector for the room. */
	int[] exitVector;

	public Door(int[] x, int[] exitVector) {
		super(x);
		this.exitVector = exitVector.clone();
	}

	public int[] getExitVector() {
		return exitVector;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + Arrays.hashCode(exitVector);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (!(obj instanceof Door))
			return false;
		Door other = (Door) obj;
		if (!Arrays.equals(exitVector, other.exitVector))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Door [getExitVector()=" + Arrays.toString(getExitVector())
				+ ", getBoundMin()=" + Arrays.toString(getBoundMin())
				+ ", getBoundMax()=" + Arrays.toString(getBoundMax()) + "]";
	}
}